package xyz.xtt.schedule.mapper.asset;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import xyz.xtt.schedule.entity.AssetTransactionEntity;

import java.util.List;

/**
 * @author wangqi
 */
public interface AssetTransactionMapper extends BaseMapper<AssetTransactionEntity> {

    /**
     * 查询待转移的数字资产
     */
    @Select("SELECT * FROM tbl_asset_transaction WHERE (deal_state = 1 AND seller_user_id <> buyer_user_id AND order_type != 12 AND (deal_hash = '' OR deal_hash IS NULL))")
    List<AssetTransactionEntity> findTransferList();

    /**
     * 查询待销毁的数字资产
     * 付过款 没上链 买方userid=0
     */
    @Select("SELECT * FROM tbl_asset_transaction WHERE (deal_state = 1 AND order_type = 12 AND (deal_hash = '' OR deal_hash IS NULL))")
    List<AssetTransactionEntity> findBurnList();
}
